3.33 \(\int \frac{(c+d x)^2}{a+a \tanh (e+f x)} \, dx\)

Optimal. Leaf size=122 \[ -\frac{d (c+d x)}{2 f^2 (a \tanh (e+f x)+a)}-\frac{(c+d x)^2}{2 f (a \tanh (e+f x)+a)}+\frac{(c+d x)^2}{4 a f}+\frac{(c+d x)^3}{6 a d}-\frac{d^2}{4 f^3 (a \tanh (e+f x)+a)}+\frac{d^2 x}{4 a f^2} \]

[Out]

(d^2*x)/(4*a*f^2) + (c + d*x)^2/(4*a*f) + (c + d*x)^3/(6*a*d) - d^2/(4*f^3*(a + a*Tanh[e + f*x])) - (d*(c + d*
x))/(2*f^2*(a + a*Tanh[e + f*x])) - (c + d*x)^2/(2*f*(a + a*Tanh[e + f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.118215, antiderivative size = 122, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.15, Rules used = {3723, 3479, 8} \[ -\frac{d (c+d x)}{2 f^2 (a \tanh (e+f x)+a)}-\frac{(c+d x)^2}{2 f (a \tanh (e+f x)+a)}+\frac{(c+d x)^2}{4 a f}+\frac{(c+d x)^3}{6 a d}-\frac{d^2}{4 f^3 (a \tanh (e+f x)+a)}+\frac{d^2 x}{4 a f^2} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*x)^2/(a + a*Tanh[e + f*x]),x]

[Out]

(d^2*x)/(4*a*f^2) + (c + d*x)^2/(4*a*f) + (c + d*x)^3/(6*a*d) - d^2/(4*f^3*(a + a*Tanh[e + f*x])) - (d*(c + d*
x))/(2*f^2*(a + a*Tanh[e + f*x])) - (c + d*x)^2/(2*f*(a + a*Tanh[e + f*x]))

Rule 3723

Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c + d*x)^(m + 1)/(2*
a*d*(m + 1)), x] + (Dist[(a*d*m)/(2*b*f), Int[(c + d*x)^(m - 1)/(a + b*Tan[e + f*x]), x], x] - Simp[(a*(c + d*
x)^m)/(2*b*f*(a + b*Tan[e + f*x])), x]) /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3479

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(a*(a + b*Tan[c + d*x])^n)/(2*b*d*n), x] +
Dist[1/(2*a), Int[(a + b*Tan[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{(c+d x)^2}{a+a \tanh (e+f x)} \, dx &=\frac{(c+d x)^3}{6 a d}-\frac{(c+d x)^2}{2 f (a+a \tanh (e+f x))}+\frac{d \int \frac{c+d x}{a+a \tanh (e+f x)} \, dx}{f}\\ &=\frac{(c+d x)^2}{4 a f}+\frac{(c+d x)^3}{6 a d}-\frac{d (c+d x)}{2 f^2 (a+a \tanh (e+f x))}-\frac{(c+d x)^2}{2 f (a+a \tanh (e+f x))}+\frac{d^2 \int \frac{1}{a+a \tanh (e+f x)} \, dx}{2 f^2}\\ &=\frac{(c+d x)^2}{4 a f}+\frac{(c+d x)^3}{6 a d}-\frac{d^2}{4 f^3 (a+a \tanh (e+f x))}-\frac{d (c+d x)}{2 f^2 (a+a \tanh (e+f x))}-\frac{(c+d x)^2}{2 f (a+a \tanh (e+f x))}+\frac{d^2 \int 1 \, dx}{4 a f^2}\\ &=\frac{d^2 x}{4 a f^2}+\frac{(c+d x)^2}{4 a f}+\frac{(c+d x)^3}{6 a d}-\frac{d^2}{4 f^3 (a+a \tanh (e+f x))}-\frac{d (c+d x)}{2 f^2 (a+a \tanh (e+f x))}-\frac{(c+d x)^2}{2 f (a+a \tanh (e+f x))}\\ \end{align*}

Mathematica [A]  time = 0.260144, size = 169, normalized size = 1.39 \[ \frac{\text{sech}(e+f x) (\sinh (f x)+\cosh (f x)) \left (\frac{4}{3} f^3 x \left (3 c^2+3 c d x+d^2 x^2\right ) (\sinh (e)+\cosh (e))+(\sinh (e)-\cosh (e)) \cosh (2 f x) \left (2 c^2 f^2+2 c d f (2 f x+1)+d^2 \left (2 f^2 x^2+2 f x+1\right )\right )+(\cosh (e)-\sinh (e)) \sinh (2 f x) \left (2 c^2 f^2+2 c d f (2 f x+1)+d^2 \left (2 f^2 x^2+2 f x+1\right )\right )\right )}{8 a f^3 (\tanh (e+f x)+1)} \]

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)^2/(a + a*Tanh[e + f*x]),x]

[Out]

(Sech[e + f*x]*(Cosh[f*x] + Sinh[f*x])*((2*c^2*f^2 + 2*c*d*f*(1 + 2*f*x) + d^2*(1 + 2*f*x + 2*f^2*x^2))*Cosh[2
*f*x]*(-Cosh[e] + Sinh[e]) + (4*f^3*x*(3*c^2 + 3*c*d*x + d^2*x^2)*(Cosh[e] + Sinh[e]))/3 + (2*c^2*f^2 + 2*c*d*
f*(1 + 2*f*x) + d^2*(1 + 2*f*x + 2*f^2*x^2))*(Cosh[e] - Sinh[e])*Sinh[2*f*x]))/(8*a*f^3*(1 + Tanh[e + f*x]))

________________________________________________________________________________________

Maple [B]  time = 0.04, size = 446, normalized size = 3.7 \begin{align*}{\frac{1}{{f}^{3}a} \left ( -{d}^{2} \left ({\frac{ \left ( fx+e \right ) ^{2} \left ( \cosh \left ( fx+e \right ) \right ) ^{2}}{2}}-{\frac{ \left ( fx+e \right ) \cosh \left ( fx+e \right ) \sinh \left ( fx+e \right ) }{2}}-{\frac{ \left ( fx+e \right ) ^{2}}{4}}+{\frac{ \left ( \cosh \left ( fx+e \right ) \right ) ^{2}}{4}} \right ) -2\,cdf \left ( 1/2\, \left ( fx+e \right ) \left ( \cosh \left ( fx+e \right ) \right ) ^{2}-1/4\,\cosh \left ( fx+e \right ) \sinh \left ( fx+e \right ) -1/4\,fx-e/4 \right ) +2\,{d}^{2}e \left ( 1/2\, \left ( fx+e \right ) \left ( \cosh \left ( fx+e \right ) \right ) ^{2}-1/4\,\cosh \left ( fx+e \right ) \sinh \left ( fx+e \right ) -1/4\,fx-e/4 \right ) -{\frac{ \left ( \cosh \left ( fx+e \right ) \right ) ^{2}{c}^{2}{f}^{2}}{2}}+ \left ( \cosh \left ( fx+e \right ) \right ) ^{2}cdfe-{\frac{ \left ( \cosh \left ( fx+e \right ) \right ) ^{2}{d}^{2}{e}^{2}}{2}}+{d}^{2} \left ({\frac{ \left ( fx+e \right ) ^{2}\cosh \left ( fx+e \right ) \sinh \left ( fx+e \right ) }{2}}+{\frac{ \left ( fx+e \right ) ^{3}}{6}}-{\frac{ \left ( fx+e \right ) \left ( \cosh \left ( fx+e \right ) \right ) ^{2}}{2}}+{\frac{\cosh \left ( fx+e \right ) \sinh \left ( fx+e \right ) }{4}}+{\frac{fx}{4}}+{\frac{e}{4}} \right ) +2\,cdf \left ( 1/2\, \left ( fx+e \right ) \cosh \left ( fx+e \right ) \sinh \left ( fx+e \right ) +1/4\, \left ( fx+e \right ) ^{2}-1/4\, \left ( \cosh \left ( fx+e \right ) \right ) ^{2} \right ) -2\,{d}^{2}e \left ( 1/2\, \left ( fx+e \right ) \cosh \left ( fx+e \right ) \sinh \left ( fx+e \right ) +1/4\, \left ( fx+e \right ) ^{2}-1/4\, \left ( \cosh \left ( fx+e \right ) \right ) ^{2} \right ) +{c}^{2}{f}^{2} \left ({\frac{\cosh \left ( fx+e \right ) \sinh \left ( fx+e \right ) }{2}}+{\frac{fx}{2}}+{\frac{e}{2}} \right ) -2\,cdfe \left ( 1/2\,\cosh \left ( fx+e \right ) \sinh \left ( fx+e \right ) +1/2\,fx+e/2 \right ) +{d}^{2}{e}^{2} \left ({\frac{\cosh \left ( fx+e \right ) \sinh \left ( fx+e \right ) }{2}}+{\frac{fx}{2}}+{\frac{e}{2}} \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)^2/(a+a*tanh(f*x+e)),x)

[Out]

1/f^3/a*(-d^2*(1/2*(f*x+e)^2*cosh(f*x+e)^2-1/2*(f*x+e)*cosh(f*x+e)*sinh(f*x+e)-1/4*(f*x+e)^2+1/4*cosh(f*x+e)^2
)-2*c*d*f*(1/2*(f*x+e)*cosh(f*x+e)^2-1/4*cosh(f*x+e)*sinh(f*x+e)-1/4*f*x-1/4*e)+2*d^2*e*(1/2*(f*x+e)*cosh(f*x+
e)^2-1/4*cosh(f*x+e)*sinh(f*x+e)-1/4*f*x-1/4*e)-1/2*cosh(f*x+e)^2*c^2*f^2+cosh(f*x+e)^2*c*d*f*e-1/2*cosh(f*x+e
)^2*d^2*e^2+d^2*(1/2*(f*x+e)^2*cosh(f*x+e)*sinh(f*x+e)+1/6*(f*x+e)^3-1/2*(f*x+e)*cosh(f*x+e)^2+1/4*cosh(f*x+e)
*sinh(f*x+e)+1/4*f*x+1/4*e)+2*c*d*f*(1/2*(f*x+e)*cosh(f*x+e)*sinh(f*x+e)+1/4*(f*x+e)^2-1/4*cosh(f*x+e)^2)-2*d^
2*e*(1/2*(f*x+e)*cosh(f*x+e)*sinh(f*x+e)+1/4*(f*x+e)^2-1/4*cosh(f*x+e)^2)+c^2*f^2*(1/2*cosh(f*x+e)*sinh(f*x+e)
+1/2*f*x+1/2*e)-2*c*d*f*e*(1/2*cosh(f*x+e)*sinh(f*x+e)+1/2*f*x+1/2*e)+d^2*e^2*(1/2*cosh(f*x+e)*sinh(f*x+e)+1/2
*f*x+1/2*e))

________________________________________________________________________________________

Maxima [A]  time = 1.22346, size = 170, normalized size = 1.39 \begin{align*} \frac{1}{4} \, c^{2}{\left (\frac{2 \,{\left (f x + e\right )}}{a f} - \frac{e^{\left (-2 \, f x - 2 \, e\right )}}{a f}\right )} + \frac{{\left (2 \, f^{2} x^{2} e^{\left (2 \, e\right )} -{\left (2 \, f x + 1\right )} e^{\left (-2 \, f x\right )}\right )} c d e^{\left (-2 \, e\right )}}{4 \, a f^{2}} + \frac{{\left (4 \, f^{3} x^{3} e^{\left (2 \, e\right )} - 3 \,{\left (2 \, f^{2} x^{2} + 2 \, f x + 1\right )} e^{\left (-2 \, f x\right )}\right )} d^{2} e^{\left (-2 \, e\right )}}{24 \, a f^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/(a+a*tanh(f*x+e)),x, algorithm="maxima")

[Out]

1/4*c^2*(2*(f*x + e)/(a*f) - e^(-2*f*x - 2*e)/(a*f)) + 1/4*(2*f^2*x^2*e^(2*e) - (2*f*x + 1)*e^(-2*f*x))*c*d*e^
(-2*e)/(a*f^2) + 1/24*(4*f^3*x^3*e^(2*e) - 3*(2*f^2*x^2 + 2*f*x + 1)*e^(-2*f*x))*d^2*e^(-2*e)/(a*f^3)

________________________________________________________________________________________

Fricas [A]  time = 2.14139, size = 419, normalized size = 3.43 \begin{align*} \frac{{\left (4 \, d^{2} f^{3} x^{3} - 6 \, c^{2} f^{2} - 6 \, c d f + 6 \,{\left (2 \, c d f^{3} - d^{2} f^{2}\right )} x^{2} - 3 \, d^{2} + 6 \,{\left (2 \, c^{2} f^{3} - 2 \, c d f^{2} - d^{2} f\right )} x\right )} \cosh \left (f x + e\right ) +{\left (4 \, d^{2} f^{3} x^{3} + 6 \, c^{2} f^{2} + 6 \, c d f + 6 \,{\left (2 \, c d f^{3} + d^{2} f^{2}\right )} x^{2} + 3 \, d^{2} + 6 \,{\left (2 \, c^{2} f^{3} + 2 \, c d f^{2} + d^{2} f\right )} x\right )} \sinh \left (f x + e\right )}{24 \,{\left (a f^{3} \cosh \left (f x + e\right ) + a f^{3} \sinh \left (f x + e\right )\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/(a+a*tanh(f*x+e)),x, algorithm="fricas")

[Out]

1/24*((4*d^2*f^3*x^3 - 6*c^2*f^2 - 6*c*d*f + 6*(2*c*d*f^3 - d^2*f^2)*x^2 - 3*d^2 + 6*(2*c^2*f^3 - 2*c*d*f^2 -
d^2*f)*x)*cosh(f*x + e) + (4*d^2*f^3*x^3 + 6*c^2*f^2 + 6*c*d*f + 6*(2*c*d*f^3 + d^2*f^2)*x^2 + 3*d^2 + 6*(2*c^
2*f^3 + 2*c*d*f^2 + d^2*f)*x)*sinh(f*x + e))/(a*f^3*cosh(f*x + e) + a*f^3*sinh(f*x + e))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{c^{2}}{\tanh{\left (e + f x \right )} + 1}\, dx + \int \frac{d^{2} x^{2}}{\tanh{\left (e + f x \right )} + 1}\, dx + \int \frac{2 c d x}{\tanh{\left (e + f x \right )} + 1}\, dx}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)**2/(a+a*tanh(f*x+e)),x)

[Out]

(Integral(c**2/(tanh(e + f*x) + 1), x) + Integral(d**2*x**2/(tanh(e + f*x) + 1), x) + Integral(2*c*d*x/(tanh(e
 + f*x) + 1), x))/a

________________________________________________________________________________________

Giac [A]  time = 1.18131, size = 166, normalized size = 1.36 \begin{align*} \frac{{\left (4 \, d^{2} f^{3} x^{3} e^{\left (2 \, f x + 2 \, e\right )} + 12 \, c d f^{3} x^{2} e^{\left (2 \, f x + 2 \, e\right )} + 12 \, c^{2} f^{3} x e^{\left (2 \, f x + 2 \, e\right )} - 6 \, d^{2} f^{2} x^{2} - 12 \, c d f^{2} x - 6 \, c^{2} f^{2} - 6 \, d^{2} f x - 6 \, c d f - 3 \, d^{2}\right )} e^{\left (-2 \, f x - 2 \, e\right )}}{24 \, a f^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2/(a+a*tanh(f*x+e)),x, algorithm="giac")

[Out]

1/24*(4*d^2*f^3*x^3*e^(2*f*x + 2*e) + 12*c*d*f^3*x^2*e^(2*f*x + 2*e) + 12*c^2*f^3*x*e^(2*f*x + 2*e) - 6*d^2*f^
2*x^2 - 12*c*d*f^2*x - 6*c^2*f^2 - 6*d^2*f*x - 6*c*d*f - 3*d^2)*e^(-2*f*x - 2*e)/(a*f^3)